const express = require("express"),
	  { user } = require("../schema/UserSchema"),
	  crypto = require("crypto"),
	  encryption = require("../Models/encryption")
	  router = express.Router();

router.get('/login', function (req, res) {
	res.send("请求成功");
}).post("/login", function (req, res) {
	console.log(req.body);

	const password = req.body.password;
	console.log(encryption(password));
	user.findOne({username: req.body.username})
		.then( (data) => {
			console.log(data);
		});
});

module.exports = router;